<?php
namespace app\index\controller;

use app\admin\model\User;
use app\admin\model\Question;
use think\Controller;
use think\Request;
use think\Session;

class Index extends Common
{
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
    }
    public function index(){
        if(!Session::has("user_id")==false){
            $user_id=Session::get('user_id');
        }else{
            $user_id='';
        }


        $user=new User();
        $user1=$user->getOne(['user_id'=>$user_id]);
        $question=new Question();
        $questions=$question->getAu(['q_del'=>0,'audit'=>1]);
        $coll_ques=$question->getThree();
        $this->assign("coll_ques",$coll_ques);
        $this->assign('user',$user1);
        $this->assign('questions',$questions);
        return $this->fetch();
    }
}
